import pymysql as pymysql

db = pymysql.connect(
    host="localhost",
    port=3306,
    user="root",
    database="crawler",
    password="123456",
    charset="utf8"
)
cursor = db.cursor()
cursor.execute("select version()")
print(cursor)
data = cursor.fetchone()
print(data)
cursor.close()
db.close()

